function getAngle(px, py, mx, my) {//获得人物中心和鼠标坐标连线，与y轴正半轴之间的夹角
    let x = Math.abs(px - mx);
    let y = Math.abs(py - my);
    let z = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
    let cos = y / z;
    let radina = Math.acos(cos);//用反三角函数求弧度
    let angle = Math.floor(180 / (Math.PI / radina));//将弧度转换成角度
    let quadrant=1; 
    if (mx > px && my > py) {//鼠标在第四象限
        angle = 180 - angle;
        console.log(44444)
        quadrant = 4
    }

    if (mx == px && my > py) {//鼠标在y轴负方向上
        angle = 180;
        console.log('------yyyyyy')
        quadrant = 4
    }

    if (mx > px && my == py) {//鼠标在x轴正方向上
        angle = 90;
        console.log('+++++xxxxxx')
    }

    if (mx < px && my > py) {//鼠标在第三象限
        angle = 180 + angle;
        quadrant = 3
        console.log(333333)
    }

    if (mx < px && my == py) {//鼠标在x轴负方向
        angle = 270;
        quadrant = 3
        console.log('------xxxxxx')
    }

    if (mx < px && my < py) {//鼠标在第二象限
        angle = 360 - angle;
        quadrant=2
        console.log(222222)
    }
    return {angle,quadrant};
}
export default getAngle;